Skip to content

test(spec): vendor the login lockout's Retry-After header, and pin it - #15

Merged
allanbowe merged 1 commit into
mainfrom
chore/vendor-login-429-headers
Nov 6, 2026
Merged

allanbowe merged 1 commit into
mainfrom
chore/vendor-login-429-headers

Conversation

@sasjs-dev

@sasjs-dev sasjs-dev Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Why test(spec), and no release

The vendored document is not a published artifact: package.json declares "files": ["build", "README.md", "LICENCE.md"], and npm pack @sasjs/api@0.3.0 contains build/, README.md and LICENCE.md and no spec/. A consumer reads the document on the server that generates it, not in this package, so nothing an installer gets changes and no release is due. docs(spec) would claim a published description changed; feat would cut a version for a file nobody downloads.

What this changes

sasjs/server merged #541 while this package's #14 was already merged, so the copy of api/public/swagger.yaml vendored here was taken one commit earlier: the 429 on /SASLogon/login states the Retry-After header in the operation description but not as a headers entry, which is where the server's generated document now puts it. This re-vendors the body and adds the header block.

check:routes compares the route table derived from the document, and the table carries no response headers, so a header can be dropped by a re-vendor with nothing failing. spec/vendored-document.spec.ts names the facts the table cannot carry - the headers entry and the unit in the prose - so a copy that loses one fails in CI. Measured: removing the headers block fails states the Retry-After header the sign-in lockout carries; it passes with it present.

Proof

  • npm test: 9 suites, 131 tests, all passing (coverage thresholds unchanged).
  • npm run check:routes: route table matches the spec (60 operations) - the vendored body adds a response header and changes no route.
  • npm run build: green.
  • The vendored body is now byte-identical to sasjs/server main's api/public/swagger.yaml below the six-line vendor header.

Order

@sasjs/api@0.3.0 was published at 00:13:05, 42 seconds before sasjs/server #541 merged. The sequence the PR bodies called for cannot mislead a consumer here for the reason above - the package ships no document - so the cost of the order is this one stale copy, which this PR corrects.

sasjs/server now generates a headers entry for the 429 on /SASLogon/login;
the vendored copy was taken before that and states the header only in the
operation description. check:routes compares the route table, which carries
no headers, so the copy can drop one without a failure - a new spec names
the facts the table cannot carry and fails when the block is removed.

Route table unchanged (60 operations).

@sasjs-dev sasjs-dev Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REVIEWED ON 2026-11-06 00:33 UTC

Reviewed the full diff: the 429 Retry-After header on /SASLogon/login and the spec test that pins it. The test is picked up by the existing jest run, so the guard is live.

  • spec/swagger.yaml:2726 this adds a response header to the published document, but the subject is test(spec): ..., which semantic-release scores as no release. The header only reaches consumers when the package is published, so the title should be feat(spec): ... (or docs(spec): if the vendored document is not shipped in the artefact).

No blocking issues.

@sasjs-dev

sasjs-dev Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Checked, and the vendored document is not shipped: package.json declares "files": ["build", "README.md", "LICENCE.md"], and npm pack @sasjs/api@0.3.0 contains build/, README.md and LICENCE.md and no spec/. So the header cannot reach a consumer through this package - it reaches them through sasjs/server, which ships the document it generates in build/public/swagger.yaml (verified in the published @sasjs/server@4.0.0 tarball).

That makes this the second case you named: test(spec) is the accurate type, because nothing an installer receives changes and no release is due. docs(spec) would claim a change to a published description there is none of, and feat would cut a version for a file no consumer downloads.

The PR body already said this, which is why I did not re-type it as docs - but the finding is fair: the reasoning belongs next to the type, not three paragraphs down, so I have moved it to its own heading.

@allanbowe
allanbowe merged commit 88b2fc8 into main Nov 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant